package com.yz.controller;

import com.yz.model.User;
import com.yz.vo.BackMessage;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by Yang on 2017/9/26.
 */
@RestController
public class ApiController {
    @ApiOperation(value="获得列表", notes="")
    @ApiImplicitParam(name = "action", value = "非安全驾驶行为action", required = true, dataType = "Action")
    @RequestMapping(value="/getList", method= RequestMethod.GET)
    BackMessage getUserList() {
        BackMessage bm = new BackMessage();
        List<User> list = new ArrayList<User>();
        for(int i=0; i<20; i++){
            list.add(new User(i, "用户"+i, i<10? "13131999440"+i: "1313199944"+i));
        }
        bm.setData(list);
        return bm;
    }

}
